<?php

/**
 * Navire filter form.
 *
 * @package    alainblondy
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class PersonnesIndexFormFilter extends BasePersonneFormFilter
{

    public function configure()
    {
        $this->useFields(array());
        $this->setWidget('recherche', new sfWidgetFormInputText());
        $this->setValidator('recherche', new sfValidatorString());
    }

    public function addRechercheColumnQuery(Doctrine_Query $query, $field, $value)
    {
        $query
            ->addWhere('nom LIKE ?', '%' . $value . '%')
            ->orWhere('prenom LIKE ?', '%' . $value . '%')
            ->orWhere('description LIKE ?', '%' . $value . '%');
    }
}
